REM @ECHO off
REM build vc9 monitor plugins program, coded by zhengjun ye
REM first argu is path to monitor plugin source
REM second argu is project name of monitor plugin
REM third argu is plugin zip package name
REM fourth argu is plugin package version
REM fifth argu is plugin package build-number

REM define variables
if "%VS2008_COMMAND%"=="" (
	set VS2008_COMMAND=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
)
set LOG_FILE=".\build_vc9_mct_os.log"

REM clean up log file
date /t > %LOG_FILE%
time /t >> %LOG_FILE%

del /q .\lib\*.*
copy .\lib\win-32\* .\lib\

REM Build mct os and make zip package
"%VS2008_COMMAND%"  /rebuild Release /project %~1\%~2.vcproj MctOS.sln /out  %LOG_FILE%
"%VS2008_COMMAND%"  /rebuild Release /project src\mct_commlib\mct_commlib.vcproj MctOS.sln /out  %LOG_FILE%
"%VS2008_COMMAND%"  /rebuild Release /project test\mct_os_test\mct_os_test.vcproj MctOS.sln /out  %LOG_FILE%

cd lib
CALL mct_os_test.exe >> ..\%LOG_FILE%
zip.exe -r %~3-%~4-%~5-win2003.zip .\*.dll .\*.lib ..\include >> ..\%LOG_FILE%
cd ..\

date /t >> %LOG_FILE%
time /t >> %LOG_FILE%

REM check result
CALL build_checkerror.bat %LOG_FILE%

